<template>
    <div>
        <PictureViewer v-if="showImg" @cancel="onPicViewCancel" :vimgdatas="datalist" :showindex="showIndex" :iskeysearch="false"/>
    </div>
</template>

<script>
import api from '@/api/api'
import PictureViewer from '@/components/PictureViewer'
export default {
    components:{PictureViewer},
    data(){
        return {
            showImg:false,
            showIndex:0,
            datalist:[]
        }
    },
    mounted(){
        let id = this.$route.query.id;
        let url=this.$route.query.url;
        let img=new Image();
        img.src=url;
        
        let that=this;
        img.onload=function(){
            that.datalist.push({w:img.width,h:img.height,src:url,id:id, thumbnailBean:{ id }})
            that.showImg=true;
        }
    },
    methods:{
        onPicViewCancel(){
            this.$router.push({path:'/inspiration?filterCapType=2'})
        }
    }
}
</script>